<?php

/**
 * @author Samrat Khan - May 11, 2013
 */

function getCustomerInfo($id, $db){
	$query = "SELECT * FROM customerinfo WHERE cus_id={$id} LIMIT 1";
    var_dump($query);
    
    try {
        $stmt = $db->prepare($query);
        $stmt->execute();
    } catch (PDOException $ex) {
        die("Failed to run query: " . $ex->getMessage());
    }
    $row1 = $stmt->fetchAll();
    var_dump($row1);
    
    $Info.="<address>";
        $Info.="<h4>".$row1[0]['keycontact_person']."</h4>";
        $Info.="<h6>".$row1[0]['cellnumber']."</h6>";
        $Info.=nl2br($row1[0]['cusaddress']);
    $Info.="</address>";
    
    return $Info;
}
?>
